package com.lmr.controller;

import com.lmr.module.InMessage;
import com.lmr.service.WebSocketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Created by ldd on 2020/1/2.
 */
@Controller
public class WebSocketController {


    @Autowired
    private WebSocketService webSocketService;

    @MessageMapping("/chat/message")
    public void onChatMessage(@RequestBody InMessage inMessage){
        webSocketService.onChatUserMessage( inMessage );
    }

}
